import Vue from 'vue'
import Router from 'vue-router'
import RouterModule from 'vue-router-module'

Vue.use(Router)

// 定义TestShowChild的子模块
const TestShowChildModuleChild01 = RouterModule.def({
  name: 'childPage01',
  path: 'child-page',
  component: () => import('_c/test-vue-router-extensions/test-show-child/child-page')
})

// 定义TestShowChild模块
const TestShowChildModule = RouterModule.def({
  name: 'testShowChild',
  path: 'test-show-child',
  component: () => import('_c/test-vue-router-extensions/test-show-child'),
  children: [TestShowChildModuleChild01]
})

// 定义Home模块
const HomeModule = RouterModule.def({
  name: 'home',
  path: '/',
  component: () => import('_c/home'),
  meta: {
    slideBack: false
  },
  children: [TestShowChildModule]
})

export default new Router({
  routes: [
    HomeModule('')
  ]
})
